{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 斐波那契数列"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0 \n",
      "\n",
      "1 \n",
      "\n",
      "1 \n",
      "\n",
      "2 \n",
      "\n",
      "3 \n",
      "\n",
      "5 \n",
      "\n",
      "8 \n",
      "\n",
      "13 \n",
      "\n",
      "21 \n",
      "\n",
      "34 \n",
      "\n",
      "55 \n",
      "\n",
      "89 \n",
      "\n"
     ]
    }
   ],
   "source": [
    "def fib(n):\n",
    "    a,b = 0,1\n",
    "    while a<n:\n",
    "        print(a,end=\" \")\n",
    "        a,b = b,a+b\n",
    "        print(\"\\n\")\n",
    "fib(100)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
